/*
 * CreatureList.java
 *
 * Created on October 17, 2007, 9:17 AM
 */

package jia.editor.lists;

import jia.editor.EditorMain;
import jia.editor.forms.CreatureForm;
import jia.editor.widgets.CreaturesTable;
import jia.tools.PanelSwapper;

/**
 *
 * @author  estell
 */
public class pnl_CreatureList extends javax.swing.JPanel {
    
    /** Creates new form CreatureList */
    public pnl_CreatureList() {
        initComponents();
        this.scrl_CreatureList.setViewportView(new CreaturesTable(this));
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        btn_CreatureListCancel = new javax.swing.JButton();
        btn_CreatureNew = new javax.swing.JButton();
        sp_CreatureListMain = new javax.swing.JSplitPane();
        scrl_CreatureDetailsText = new javax.swing.JScrollPane();
        txt_CreatureDetails = new javax.swing.JTextArea();
        scrl_CreatureList = new javax.swing.JScrollPane();
        btn_CreatureEdit = new javax.swing.JButton();
        btn_CreatureDelete = new javax.swing.JButton();

        btn_CreatureListCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/door_out.png")));
        btn_CreatureListCancel.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_CreatureListCancel.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel"));
        btn_CreatureListCancel.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_CreatureListCancel.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_CreatureListCancel.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_CreatureListCancel.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_CreatureListCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_CreatureListCancelActionPerformed(evt);
            }
        });

        btn_CreatureListCancel.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel_lbl"));
        btn_CreatureListCancel.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Cancel"));

        btn_CreatureNew.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/add.png")));
        btn_CreatureNew.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_CreatureNew.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add"));
        btn_CreatureNew.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_CreatureNew.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_CreatureNew.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_CreatureNew.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_CreatureNew.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_CreatureNewActionPerformed(evt);
            }
        });

        btn_CreatureNew.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add_lbl"));
        btn_CreatureNew.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Add"));

        sp_CreatureListMain.setBorder(javax.swing.BorderFactory.createTitledBorder(null, java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("title_Creatures"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.BELOW_TOP));
        sp_CreatureListMain.setDividerLocation(400);
        sp_CreatureListMain.setDividerSize(7);
        sp_CreatureListMain.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        sp_CreatureListMain.setLastDividerLocation(400);
        sp_CreatureListMain.setOneTouchExpandable(true);
        sp_CreatureListMain.setPreferredSize(new java.awt.Dimension(642, 558));
        txt_CreatureDetails.setBackground(new java.awt.Color(0, 0, 0));
        txt_CreatureDetails.setColumns(20);
        txt_CreatureDetails.setEditable(false);
        txt_CreatureDetails.setForeground(new java.awt.Color(255, 255, 255));
        txt_CreatureDetails.setRows(5);
        scrl_CreatureDetailsText.setViewportView(txt_CreatureDetails);

        sp_CreatureListMain.setRightComponent(scrl_CreatureDetailsText);

        sp_CreatureListMain.setLeftComponent(scrl_CreatureList);

        btn_CreatureEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/pencil.png")));
        btn_CreatureEdit.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_CreatureEdit.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit"));
        btn_CreatureEdit.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_CreatureEdit.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_CreatureEdit.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_CreatureEdit.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_CreatureEdit.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit_lbl"));
        btn_CreatureEdit.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Edit"));

        btn_CreatureDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jia_ui/images/delete.png")));
        btn_CreatureDelete.setText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_CreatureDelete.setToolTipText(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete"));
        btn_CreatureDelete.setActionCommand(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_CreatureDelete.setLabel(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_CreatureDelete.setName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_CreatureDelete.setPreferredSize(new java.awt.Dimension(132, 30));
        btn_CreatureDelete.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete_lbl"));
        btn_CreatureDelete.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("jia_ui/images/formUI").getString("btn_Delete"));

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(sp_CreatureListMain, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(btn_CreatureNew, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(btn_CreatureEdit, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(btn_CreatureDelete, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(btn_CreatureListCancel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(sp_CreatureListMain, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(layout.createSequentialGroup()
                        .add(btn_CreatureNew, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btn_CreatureEdit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(btn_CreatureDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(btn_CreatureListCancel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btn_CreatureNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_CreatureNewActionPerformed
        
       // EditorMain.p_creatureForm.setCreatureData();
        PanelSwapper.swap(new CreatureForm(), this);
    }//GEN-LAST:event_btn_CreatureNewActionPerformed

    private void btn_CreatureListCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_CreatureListCancelActionPerformed
        PanelSwapper.swap(EditorMain.p_defaultAdminPanel, this);
    }//GEN-LAST:event_btn_CreatureListCancelActionPerformed

    public void setConsoleText(String string) {
        this.txt_CreatureDetails.setText(string);
    }

    public String getConsoleText() {
        return this.txt_CreatureDetails.getText();
    }
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_CreatureDelete;
    private javax.swing.JButton btn_CreatureEdit;
    private javax.swing.JButton btn_CreatureListCancel;
    private javax.swing.JButton btn_CreatureNew;
    private javax.swing.JScrollPane scrl_CreatureDetailsText;
    private javax.swing.JScrollPane scrl_CreatureList;
    private javax.swing.JSplitPane sp_CreatureListMain;
    private javax.swing.JTextArea txt_CreatureDetails;
    // End of variables declaration//GEN-END:variables
    
}
